<?php

namespace app\common\model;

use think\Model;

class Admin extends Model
{
    // TODO 链接admin
    protected $table = "pre_admin";
    // 软删除
    protected $deleteTime = 'deletetime';

    public function getStateTextAttr($value, $data)
    {
        $stateList = [
            0 => '禁用',
            1 => '正常',
        ];

        return $stateList[$data['state']];
    }

    public function getDeletetimeTextAttr($value,$data){
        return date('Y-m-d H:i:s',$data['deletetime']);
    }
}
